/*
* 继承Thread创建线程
* */
public class ThreadDemo3 {
    public static void main(String[] args) {
        Thread mainThread=Thread.currentThread();
        Thread thread=new MyThread();
        System.out.println("线程名称"+mainThread.getName());
        thread.run();
    }
}
class MyThread extends Thread{

    public void run(){
        Thread thread=Thread.currentThread();
        System.out.println("你好，线程");
        System.out.println("线程的名称："+thread.getName());
    }







}
